home *** CD-ROM | disk | FTP | other *** search
- ;-------T-------T------------------------T----------------------------------;
- ;Test routine for ClearBob()
- ;---------------------------
-
- INCDIR "INCLUDES:"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i"
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- SECTION "ClearBOB",CODE
-
- ;===========================================================================;
- ; INITIALISE DEMO
- ;===========================================================================;
-
- STARTGMS
-
- Start: MOVEM.L A0-A6/D1-D7,-(SP)
- move.l GMSBase(pc),a6 ;Activate user preferences.
- CALL AllocBlitter ;Allocate the blitter.
- tst.l d0
- bne .Error_Blitter
-
- CALL AllocAudio
- tst.l d0
- bne .Error_Audio
-
- lea ScreenTags(pc),a0 ;Initialise the screen.
- CALL AddScreen
- tst.l d0
- beq.s .Error_Screen
-
- move.l Screen(pc),a0
- lea PIC_BackgroundTags(pc),a1 ;Load the picture.
- move.l GS_MemPtr1(a0),PicData
- CALL LoadPic
- tst.l d0
- beq.s .Error_Picture
-
- move.l PIC_Background(pc),a1
- move.l PIC_Palette(a1),GS_Palette(a0)
- CALL UpdatePalette
-
- move.l Screen(pc),a0 ;Initialise the bob so that it is
- lea BBT_Rambo(pc),a1 ;ready for drawing.
- CALL InitBob
- tst.l d0
- beq.s .Error_BOB
-
- lea SMT_Rambo(pc),a0
- CALL InitSound
- tst.l d0
- beq.s .Error_Sound
-
- move.l Screen(pc),a0
- CALL ShowScreen
-
- bsr.s Main
-
- .ReturnToDOS
- move.l GMSBase(pc),a6
- move.l SND_Rambo(pc),a0
- CALL FreeSound
- .Error_Sound
- move.l BOB_Rambo(pc),a1
- CALL FreeBob
- .Error_BOB
- move.l PIC_Background(pc),a1
- CALL FreePic
- .Error_Picture
- move.l Screen(pc),a0
- CALL DeleteScreen
- .Error_Screen
- CALL FreeAudio
- .Error_Audio
- CALL FreeBlitter
- .Error_Blitter
- MOVEM.L (SP)+,A0-A6/D1-D7
- moveq #ERR_OK,d0
- rts
-
- ;===========================================================================;
- ; MAIN LOOP
- ;===========================================================================;
-
- SPEED = 5
- FIRESPEED = 1
-
- Main: move.l GMSBase(pc),a6
- CALL InitJoyPorts
- moveq #$00,d7
-
- .Loop move.l Screen(pc),a0
- move.l BOB_Rambo(pc),a1
- move.w #BUFFER1,d0
- CALL ClearBob ;Blit the bob.
- CALL WaitVBL ;Wait for VBL.
- CALL SwapBuffers
- addq.w #1,d7
-
- tst.b FireState
- bne.s .FireOn
-
- cmp.w #SPEED,d7
- ble.s .Move
- moveq #$00,d7
- addq.w #1,BOB_Frame(a1)
- cmp.w #9,BOB_Frame(a1)
- blt.s .Move
- clr.w BOB_Frame(a1)
- bra.s .Move
-
- .FireOn cmp.w #FIRESPEED,d7
- ble.s .Move
- moveq #$00,d7
- cmp.w #10,BOB_Frame(a1)
- bge.s .On
- move.w #9,BOB_Frame(a1)
-
- .On addq.w #1,BOB_Frame(a1)
- cmp.w #13,BOB_Frame(a1)
- blt.s .Move
-
- move.l SND_Rambo(pc),a0
- CALL PlaySound
-
- btst #MB_LMB,d0
- beq.s .Off
- move.w #11,BOB_Frame(a1)
- bra.s .Move
-
- .Off clr.w BOB_Frame(a1)
- clr.b FireState
-
- .Move moveq #JPORT1,d0 ;Read the mouse, then update the
- moveq #JT_ZBXY,d1 ;BOB's X and Y co-ordinates.
- CALL ReadJoyPort
- move.w d0,d1
- ext.w d0
- add.w d0,BOB_YPos(a1)
- asr.w #8,d1
- add.w d1,BOB_XPos(a1)
-
- btst #MB_LMB,d0
- beq.s .chkRMB
- st FireState ;Set fire to on.
- .chkRMB btst #MB_RMB,d0
- beq .Loop
- rts
-
- FireState:
- dc.b 0
- even
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- ScreenTags:
- dc.l TAGS_GAMESCREEN
- Screen: dc.l 0
- dc.l GSA_ScrWidth,320
- dc.l GSA_ScrHeight,256
- dc.l GSA_Planes,5
- dc.l TAGEND
-
- PIC_BackgroundTags:
- dc.l TAGS_PICTURE
- PIC_Background:
- dc.l 0
- dc.l PCA_Data
- PicData dc.l 0
- dc.l PCA_Width,320
- dc.l PCA_Height,256
- dc.l PCA_Planes,5
- dc.l PCA_Options,GETPALETTE
- dc.l PCA_File,.file
- dc.l TAGEND
- .file dc.b "GMS:demos/data/PIC.Green",0
- even
-
- BBT_Rambo:
- dc.l TAGS_BOB
- BOB_Rambo:
- dc.l 0
- dc.l BBA_Framelist,.frames
- dc.l BBA_Width,32
- dc.l BBA_ByteWidth,32/8
- dc.l BBA_Height,24
- dc.l BBA_XCoord,66
- dc.l BBA_YCoord,66
- dc.l BBA_ClipLX,32
- dc.l BBA_ClipRX,320-32
- dc.l BBA_ClipTY,32
- dc.l BBA_ClipBY,256-32
- dc.l BBA_Attrib,CLRMASK|GENMASKS|CLIP
- dc.l BBA_PictureTags,.picture
- dc.l TAGEND
- .picture
- dc.l TAGS_PICTURE,0
- dc.l PCA_Planes,5
- dc.l PCA_Options,BLITMEM
- dc.l PCA_FILE,.file
- dc.l TAGEND
- .file dc.b "GMS:demos/data/PIC.Rambo",0
- even
-
- .frames dc.w 000,00,0,0 ;0 X/Y Graphic, X/Y Mask
- dc.w 032,00,0,0 ;1 ...
- dc.w 064,00,0,0 ;2
- dc.w 096,00,0,0 ;3
- dc.w 128,00,0,0 ;4
- dc.w 160,00,0,0 ;5
- dc.w 192,00,0,0 ;6
- dc.w 224,00,0,0 ;7
- dc.w 256,00,0,0 ;8
- dc.w 288,00,0,0 ;9
- dc.w 000,48,0,0 ;10
- dc.w 032,48,0,0 ;11
- dc.w 064,48,0,0 ;12
- dc.l -1
-
-
- SMT_Rambo:
- dc.l TAGS_SOUND
- SND_Rambo:
- dc.l 0
- dc.l SA_Channel,CHANNEL1
- dc.l SA_Octave,OCT_C2S
- dc.l SA_Volume,100
- dc.l SA_File,.file
- dc.l TAGEND
- .file dc.b "GMS:demos/data/SND.Rambo",0
- even
-
-